﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace Piyrez_LoL_Jungle_Timers
{
    public class Overlay : Form
    {
        private IContainer components = (IContainer)null;
        private PictureBox purpGolemPic;
        private PictureBox BaronPic;
        private PictureBox DragonPic;
        private PictureBox blueLizardPic;
        private PictureBox blueGolemPic;
        private PictureBox purpLizardPic;
        private PictureBox purpBox;
        private PictureBox blueBox;
        public static System.Windows.Forms.Label olDragonL;
        public static System.Windows.Forms.Label olBaronL;
        public static System.Windows.Forms.Label olblueGolemL;
        public static System.Windows.Forms.Label olblueLizardL;
        public static System.Windows.Forms.Label olpurpLizardL;
        public static System.Windows.Forms.Label olpurpGolemL;
        private PictureBox blackBox;

        [DllImport("user32.dll", SetLastError = true)]
        private static extern UInt32 GetWindowLong(IntPtr hWnd, int nIndex);

        [DllImport("user32.dll")]
        static extern int SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong);

        [DllImport("user32.dll")]
        static extern bool SetLayeredWindowAttributes(IntPtr hwnd, uint crKey, byte bAlpha, uint dwFlags);

        public const int GWL_EXSTYLE = -20;
        public const int WS_EX_LAYERED = 0x80000;
        public const int WS_EX_TRANSPARENT = 0x20;
        public const int LWA_ALPHA = 0x2;
        public const int LWA_COLORKEY = 0x1;


        
        public Overlay()
        {
            this.InitializeComponent();

            SetWindowLong(this.Handle, GWL_EXSTYLE, (IntPtr)(GetWindowLong(this.Handle, GWL_EXSTYLE) | WS_EX_LAYERED | WS_EX_TRANSPARENT));

            // set transparency to 50% (128)
            SetLayeredWindowAttributes(this.Handle, 0, 250, LWA_ALPHA);

            this.TopMost = true;

        }

        private void Overlay_Load(object sender, EventArgs e)
        {

        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && this.components != null)
                this.components.Dispose();
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.purpGolemPic = new System.Windows.Forms.PictureBox();
            this.BaronPic = new System.Windows.Forms.PictureBox();
            this.DragonPic = new System.Windows.Forms.PictureBox();
            this.blueLizardPic = new System.Windows.Forms.PictureBox();
            this.blueGolemPic = new System.Windows.Forms.PictureBox();
            this.purpLizardPic = new System.Windows.Forms.PictureBox();
            this.purpBox = new System.Windows.Forms.PictureBox();
            this.blueBox = new System.Windows.Forms.PictureBox();
            this.blackBox = new System.Windows.Forms.PictureBox();
            olDragonL = new System.Windows.Forms.Label();
            olblueGolemL = new System.Windows.Forms.Label();
            olBaronL = new System.Windows.Forms.Label();
            olblueLizardL = new System.Windows.Forms.Label();
            olpurpLizardL = new System.Windows.Forms.Label();
            olpurpGolemL = new System.Windows.Forms.Label();
            ((System.ComponentModel.ISupportInitialize)(this.purpGolemPic)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.BaronPic)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.DragonPic)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.blueLizardPic)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.blueGolemPic)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.purpLizardPic)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.purpBox)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.blueBox)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.blackBox)).BeginInit();
            this.SuspendLayout();
            // 
            // purpGolemPic
            // 
            this.purpGolemPic.BackColor = System.Drawing.Color.Transparent;
            this.purpGolemPic.Image = global::Piyrez_LoL_Jungle_Timers.Properties.Resources.purp_Golem;
            this.purpGolemPic.InitialImage = null;
            this.purpGolemPic.Location = new System.Drawing.Point(2, 2);
            this.purpGolemPic.Name = "purpGolemPic";
            this.purpGolemPic.Size = new System.Drawing.Size(50, 50);
            this.purpGolemPic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.purpGolemPic.TabIndex = 3;
            this.purpGolemPic.TabStop = false;
            // 
            // BaronPic
            // 
            this.BaronPic.BackColor = System.Drawing.Color.Black;
            this.BaronPic.Image = global::Piyrez_LoL_Jungle_Timers.Properties.Resources.Baron;
            this.BaronPic.Location = new System.Drawing.Point(114, 2);
            this.BaronPic.Name = "BaronPic";
            this.BaronPic.Size = new System.Drawing.Size(50, 50);
            this.BaronPic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.BaronPic.TabIndex = 21;
            this.BaronPic.TabStop = false;
            // 
            // DragonPic
            // 
            this.DragonPic.BackColor = System.Drawing.Color.Black;
            this.DragonPic.Image = global::Piyrez_LoL_Jungle_Timers.Properties.Resources.Dragon;
            this.DragonPic.Location = new System.Drawing.Point(114, 55);
            this.DragonPic.Name = "DragonPic";
            this.DragonPic.Size = new System.Drawing.Size(50, 50);
            this.DragonPic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.DragonPic.TabIndex = 20;
            this.DragonPic.TabStop = false;
            // 
            // blueLizardPic
            // 
            this.blueLizardPic.BackColor = System.Drawing.Color.Transparent;
            this.blueLizardPic.Image = global::Piyrez_LoL_Jungle_Timers.Properties.Resources.blue_Lizard;
            this.blueLizardPic.Location = new System.Drawing.Point(58, 55);
            this.blueLizardPic.Name = "blueLizardPic";
            this.blueLizardPic.Size = new System.Drawing.Size(50, 50);
            this.blueLizardPic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.blueLizardPic.TabIndex = 19;
            this.blueLizardPic.TabStop = false;
            // 
            // blueGolemPic
            // 
            this.blueGolemPic.BackColor = System.Drawing.Color.Transparent;
            this.blueGolemPic.Image = global::Piyrez_LoL_Jungle_Timers.Properties.Resources.blue_Golem;
            this.blueGolemPic.InitialImage = null;
            this.blueGolemPic.Location = new System.Drawing.Point(2, 55);
            this.blueGolemPic.Name = "blueGolemPic";
            this.blueGolemPic.Size = new System.Drawing.Size(50, 50);
            this.blueGolemPic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.blueGolemPic.TabIndex = 18;
            this.blueGolemPic.TabStop = false;
            // 
            // purpLizardPic
            // 
            this.purpLizardPic.BackColor = System.Drawing.Color.Transparent;
            this.purpLizardPic.Image = global::Piyrez_LoL_Jungle_Timers.Properties.Resources.purp_Lizard;
            this.purpLizardPic.Location = new System.Drawing.Point(58, 2);
            this.purpLizardPic.Name = "purpLizardPic";
            this.purpLizardPic.Size = new System.Drawing.Size(50, 50);
            this.purpLizardPic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
            this.purpLizardPic.TabIndex = 17;
            this.purpLizardPic.TabStop = false;
            // 
            // purpBox
            // 
            this.purpBox.BackColor = System.Drawing.Color.SlateBlue;
            this.purpBox.Location = new System.Drawing.Point(-8, -7);
            this.purpBox.Name = "purpBox";
            this.purpBox.Size = new System.Drawing.Size(126, 73);
            this.purpBox.TabIndex = 22;
            this.purpBox.TabStop = false;
            // 
            // blueBox
            // 
            this.blueBox.BackColor = System.Drawing.Color.RoyalBlue;
            this.blueBox.Location = new System.Drawing.Point(-8, 53);
            this.blueBox.Name = "blueBox";
            this.blueBox.Size = new System.Drawing.Size(140, 61);
            this.blueBox.TabIndex = 23;
            this.blueBox.TabStop = false;
            // 
            // blackBox
            // 
            this.blackBox.BackColor = System.Drawing.Color.Black;
            this.blackBox.Location = new System.Drawing.Point(110, -3);
            this.blackBox.Name = "blackBox";
            this.blackBox.Size = new System.Drawing.Size(63, 117);
            this.blackBox.TabIndex = 24;
            this.blackBox.TabStop = false;
            // 
            // olDragonL
            // 
            olDragonL.AutoSize = true;
            //olDragonL.BackColor = System.Drawing.Color.Transparent;
            olDragonL.Font = new System.Drawing.Font("Comic Sans MS", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            olDragonL.ForeColor = System.Drawing.Color.Red;
            olDragonL.Location = new System.Drawing.Point(117, 81);
            olDragonL.Name = "olDragonL";
            olDragonL.Size = new System.Drawing.Size(39, 23);
            olDragonL.TabIndex = 29;
            olDragonL.Text = "Off";
            // 
            // olblueGolemL
            // 
            olblueGolemL.AutoSize = true;
            olblueGolemL.Font = new System.Drawing.Font("Comic Sans MS", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            olblueGolemL.ForeColor = System.Drawing.Color.Red;
            olblueGolemL.Location = new System.Drawing.Point(4, 81);
            olblueGolemL.Name = "olblueGolemL";
            olblueGolemL.Size = new System.Drawing.Size(39, 23);
            olblueGolemL.TabIndex = 27;
            olblueGolemL.Text = "Off";
            // 
            // olBaronL
            // 
            olBaronL.AutoSize = true;
            olBaronL.Font = new System.Drawing.Font("Comic Sans MS", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            olBaronL.ForeColor = System.Drawing.Color.Red;
            olBaronL.Location = new System.Drawing.Point(117, 27);
            olBaronL.Name = "olBaronL";
            olBaronL.Size = new System.Drawing.Size(39, 23);
            olBaronL.TabIndex = 30;
            olBaronL.Text = "Off";
            // 
            // olblueLizardL
            // 
            olblueLizardL.AutoSize = true;
            olblueLizardL.Font = new System.Drawing.Font("Comic Sans MS", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            olblueLizardL.ForeColor = System.Drawing.Color.Red;
            olblueLizardL.Location = new System.Drawing.Point(61, 81);
            olblueLizardL.Name = "olblueLizardL";
            olblueLizardL.Size = new System.Drawing.Size(39, 23);
            olblueLizardL.TabIndex = 28;
            olblueLizardL.Text = "Off";
            // 
            // olpurpLizardL
            // 
            olpurpLizardL.AutoSize = true;
            olpurpLizardL.Font = new System.Drawing.Font("Comic Sans MS", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            olpurpLizardL.ForeColor = System.Drawing.Color.Red;
            olpurpLizardL.Location = new System.Drawing.Point(61, 28);
            olpurpLizardL.Name = "olpurpLizardL";
            olpurpLizardL.Size = new System.Drawing.Size(39, 23);
            olpurpLizardL.TabIndex = 26;
            olpurpLizardL.Text = "Off";
            // 
            // olpurpGolemL
            // 
            olpurpGolemL.AutoSize = true;
            olpurpGolemL.BackColor = System.Drawing.Color.Transparent;
            olpurpGolemL.Font = new System.Drawing.Font("Comic Sans MS", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            olpurpGolemL.ForeColor = System.Drawing.Color.Red;
            olpurpGolemL.Location = new System.Drawing.Point(4, 28);
            olpurpGolemL.Name = "olpurpGolemL";
            olpurpGolemL.Size = new System.Drawing.Size(39, 23);
            olpurpGolemL.TabIndex = 25;
            olpurpGolemL.Text = "Off";
            // 
            // Overlay
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
            this.ClientSize = new System.Drawing.Size(170, 108);
            this.Controls.Add(olBaronL);
            this.Controls.Add(olDragonL);
            this.Controls.Add(olblueLizardL);
            this.Controls.Add(olblueGolemL);
            this.Controls.Add(olpurpLizardL);
            this.Controls.Add(olpurpGolemL);
            this.Controls.Add(this.BaronPic);
            this.Controls.Add(this.DragonPic);
            this.Controls.Add(this.blueLizardPic);
            this.Controls.Add(this.blueGolemPic);
            this.Controls.Add(this.purpLizardPic);
            this.Controls.Add(this.purpGolemPic);
            this.Controls.Add(this.blackBox);
            this.Controls.Add(this.blueBox);
            this.Controls.Add(this.purpBox);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Location = new System.Drawing.Point(1700, 600);
            this.Name = "Overlay";
            this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
            this.Text = "Overlay";
            this.TopMost = true;
            this.Load += new System.EventHandler(this.Overlay_Load);
            ((System.ComponentModel.ISupportInitialize)(this.purpGolemPic)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.BaronPic)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.DragonPic)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.blueLizardPic)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.blueGolemPic)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.purpLizardPic)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.purpBox)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.blueBox)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.blackBox)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }
    }
}
